package com.wanli.storemobile.mine;


import android.content.Intent;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.wanli.storemobile.R;
import com.wanli.storemobile.base.BaseActivity;
import com.wanli.storemobile.utils.VersionUtil;
import com.wanli.storemobile.widget.AppTitleBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AboutUsActivity extends BaseActivity {
    @BindView(R.id.title_bar)
    AppTitleBar titleBar;
    @BindView(R.id.tv_version)
    TextView tvVersion;
    @BindView(R.id.tv_about)
    TextView tvAbout;
    @BindView(R.id.tv_protocol1)
    TextView tvProtocol1;
    @BindView(R.id.tv_protocol2)
    TextView tvProtocol2;
    @BindView(R.id.tv_protocol3)
    TextView tvProtocol3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);
        ButterKnife.bind(this);
        tvVersion.setText("当前版本  V" + VersionUtil.packageName(this));

        tvProtocol1.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
        tvProtocol1.getPaint().setAntiAlias(true);//抗锯齿
        tvProtocol2.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
        tvProtocol2.getPaint().setAntiAlias(true);//抗锯齿
        tvProtocol3.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
        tvProtocol3.getPaint().setAntiAlias(true);//抗锯齿
    }

    @OnClick({R.id.tv_protocol1, R.id.tv_protocol2, R.id.tv_protocol3})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_protocol1:
                Intent intent = new Intent(mActivity, UserAgreementActivity.class);
                intent.putExtra("type", 1);
                startActivity(intent);
                break;
            case R.id.tv_protocol2:
                intent = new Intent(mActivity, UserAgreementActivity.class);
                intent.putExtra("type", 2);
                startActivity(intent);
                break;
            case R.id.tv_protocol3:
                intent = new Intent(mActivity, UserAgreementActivity.class);
                intent.putExtra("type", 4);
                startActivity(intent);
                break;
        }
    }
}
